#ifndef FIXTUREMANAGER_H
#define FIXTUREMANAGER_H

#include <QObject>
#include <QMap>

class FixtureManager : public QObject
{
    Q_OBJECT

public:
    enum FixtureState {
        Unknown = 0,
        Clamped = 1,
        Released = 2
    };
    Q_ENUM(FixtureState)

    explicit FixtureManager(QObject *parent = nullptr);

    // 气缸状态管理
    FixtureState getFixtureState(int fixtureNumber) const;
    void setFixtureState(int fixtureNumber, FixtureState state);
    void resetAllStates();

    // 获取状态文本
    QString getStateText(FixtureState state) const;
    QString getCurrentStateText(int fixtureNumber) const;

signals:
    void fixtureStateChanged(int fixtureNumber, FixtureState state);

private:
    QMap<int, FixtureState> m_fixtureStates;
};

#endif // FIXTUREMANAGER_H
